from selenium.webdriver.common.by import By


class OrgPageElements():
    """
    定义一个枚举类，存储部门管理页面元素，如果页面元素定位方式有变动，修改元素定位即可，不需要修改代码逻辑
    """
    mail_list_button = (By.ID, "menu_contacts")     # 通讯录按钮
    add_button = (By.CLASS_NAME, "member_colLeft_top_addBtn")   # +按钮
    add_org_button = (By.CLASS_NAME, "js_create_party")     # 添加部门按钮
    org_name_input = (By.CSS_SELECTOR, "input[name=name]")  # 部门名称输入框
    parent_org_box = (By.CLASS_NAME, "js_parent_party_name")    # 所属部门下拉框
    parent_org_choose = (By.XPATH, "//div[@class='inputDlg_item']//a[text()='{}']")  # 选择所属部门，想选哪个部门，格式化传入部门名称定位

    org_index = (By.XPATH, "//a[text()='{}']")
    org_set_button = (By.XPATH, "//a[text()='{}']/span[@class='icon jstree-contextmenu-hover']")
    update_org_name_button = (By.XPATH, "//a[text()='修改名称']")
